package appli.calcul;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Resultat extends Activity{
	
	private Button valider;
	private Button partir;
	private Button aller;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.resultat);
		
		valider = (Button) findViewById(R.id.btvalrec);
		partir = (Button) findViewById(R.id.btfaireitienpar);
		aller = (Button) findViewById(R.id.btfaireitiendir);
		
		final boolean iti = getIntent().getExtras().getBoolean("iti");
		final Activity act = this;
		
		partir.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				
			}
		});
		
		aller.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				
			}
		});
		
		valider.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if(!iti)
				{
					Intent page = new Intent();
					page.putExtra("iti", iti);
					page.putExtra("nom", getIntent().getExtras().getString("nom"));
					page.putExtra("lat", 47.85);
					page.putExtra("lon", 1.92);
					setResult(RESULT_OK, page);
					act.finish();
				}
			}
		});
	}
}
